#!/bin/bash

grep_httperf()
{
	dataname=$1
	rate=$2
	result_file=$3
	echo "$dataname $page $rate"
	filename=httperf_data/${dataname}_apache_app_data_page_r${rate}.txt
	echo -n "$rate " >> $result_file
	if [ -e $filename ] ; then
		grep "Reply time" $filename | cut -d" " -f5,7 >> $result_file
	fi
}

dataname=$1

result_file="results/${dataname}_apache_app_data_page.csv"
echo "load response transfer" > $result_file
for r in 1 10 25 50 100
do
	grep_httperf $dataname $r $result_file
done
